1. Field of the Invention
The present invention relates to a color interpolation method and apparatus, and more particularly, to a color interpolation method and apparatus by which information on a color signal sensed by each pixel of an image sensor is received and color signals missing in the pixel are interpolated.
2. Description of the Related Art
Generally, a digital camera or camcorder uses an image sensor, such as a charge coupled device (CCD) or a complementary metal-oxide semiconductor (CMOS), instead of using a film. Since this sensor senses a brightness value of light, an image obtained by the sensor is not a color image, but a black and white image. Accordingly, in order to obtain a color image, a color filter array (hereinafter referred to as a “CFA”) transmitting a color component of red (R), green (G), and blue (B) is disposed on each pixel of the sensor, and the pixel of the sensor senses the intensity of R, G, B color signals transmitting through the CFA. This RGB color format includes the 3 primary colors of light, and covers bandwidths of wavelength ranges to which cone cells of human eyes mainly respond, and therefore are widely used to obtain a high quality image. For broadcasting equipment, 3 CCD or CMOS sensors detecting all the R, G, and B colors are also used, but a single CCD or CMOS sensor is generally used in order to reduce cost. Since information on only one color among a plurality of channel colors is stored in each pixel of the single sensor, in order to obtain color information of a complete image, information on other channel colors that is not stored in the pixel should be interpolated from color information of neighboring pixels.
FIG. 1 illustrates a Bayer CFA. In FIG. 1, it is assumed that each square corresponds to one pixel, and number ab expressed as a subscript indicates the position (a, b) of a pixel indicating an a-th row and b-th column. For example, B33 indicates a B color value of a pixel at a position (3,3).
In the Bayer CFA shown in FIG. 1, a variety of interpolation algorithms can be used in order to obtain R, G, and B values of each pixel. For example, as the interpolation algorithms, there are bilinear interpolation using the mean value of neighboring pixels, and smooth hue transition interpolation considering correlations of colors.
When the bilinear interpolation is used, the G color value (G33) of a pixel (3,3) having only a B color value (B33) can be calculated from the mean of G color values of 4 pixels that are immediately above, immediately below, immediately to the left of, and immediately to the right of the pixel (3,3), respectively, that is,
            G      33        =                            G          23                +                  G          43                +                  G          32                +                  G          34                    4        ,and the R color value (R33) can be calculated from the mean of 4 pixels adjacent to the pixel (3,3) in the diagonal directions, that is,
      R    33    =                              R          22                +                  R          24                +                  R          42                +                  R          44                    4        .  
Likewise, in a pixel having only an R or G color value, other channel color values can be interpolated by using the mean values of color values of adjacent pixels having the color channel component which is desired to be interpolated.
The smooth hue transition interpolation is to perform color interpolation by using an assumption that the difference between color channels is constant in a local region of an image. That is, in the smooth hue transition interpolation, interpolation is performed by using a difference image channel (DR, DB) obtained by subtracting an R or B color value from a G color value. Here, DR=G−R, DB=G−B.
Referring FIG. 1 again, the color interpolation process using the smooth hue transition interpolation will now be explained. First, a process of interpolating a G color value in a pixel having only an R or B color value will now be explained. For example, a process of interpolating the G color value (G33) and R color value (R33) of a pixel (3,3) having only the B color value (B33) is as the following. Values of difference image channels (DB) of pixels (2,3), (3,2), (3,4), (4,3) that are immediately above, immediately below, immediately to the left of, and immediately to the right of the pixel (3,3), respectively, are obtained. Assuming that Da,xy indicates the difference of the G color value and an arbitrary a color value in pixel (x,y), the differences (DB,23, DB,32, DB,34, DB,43) between G color values and B color values in the positions (2,3), (3,2), (3,4), and (4,3) are expressed as the following:
            D              B        ,        23              =                            G          23                -                  B          23          ′                    =                        G          23                -                                            B              13                        +                          B              33                                2                                D              B        ,        32              =                            G          32                -                  B          32          ′                    =                        G          32                -                                            B              31                        +                          B              33                                2                                D              B        ,        34              =                            G          34                -                  B          34          ′                    =                        G          23                -                                            B              33                        +                          B              35                                2                                D              B        ,        43              =                            G          43                -                  B          43          ′                    =                        G          43                -                                            B              33                        +                          B              53                                2                    
Here, the prime symbol indicates that the color value is obtained not directly by the sensor but by interpolation. The interpolated G color value (G33′) of the pixel (3,3) is calculated by adding the mean value of the difference image channel values (DB,23, DB,32, DB,34, DB,43) and the B color value (B33) of the pixel (3,3) to be currently interpolated. That is,
      G    33    ′    =            B      33        +                                        D                          B              ,              23                                +                      D                          B              ,              32                                +                      D                          B              ,              34                                +                      D                          B              ,              43                                      4            .      
Next, a process of interpolating other color values in a pixel having only an R or B color value will now be explained. For example, in a pixel (2,2) having only an R color value (R22), the B color value (B22) can be obtained by adding the mean value of the differences (DB,11, DB,13, DB,31, DB,33) of the G color values and B color values in adjacent 4 pixels (1,1), (1,3), (3,1), and (3,3) in the diagonal directions, to the G color value (G22′) of the pixel (2,2). The differences (DB,11, DB,13, DB,31, DB,33) of the G color values and B color values in the pixels (1,1), (1,3), (3,1), and (3,3) are expressed as the following:DB,11=G11′−B11, DB,13=G13′−B13 DB,31=G31′−B31, DB,33=G33′−B33 
Here, G11′, G13′, G31′, and G33′ can be interpolated from adjacent difference image channel values in the similar manner to the process of obtaining the interpolated G color value (G33′) of the pixel (3,3).
The interpolated B color value (B22′) of the pixel (2,2) can be calculated by subtracting the mean value of the difference image channel values (DB,11, DB,13, DB,31, DB,33) of the 4 pixels in the diagonal directions of the pixel (2,2) to be interpolated, from the G color value (G22′) of the pixel (2,2). That is,
      B    22    ′    =            G      22      ′        +                                        D                          B              ,              11                                +                      D                          B              ,              13                                +                      D                          B              ,              31                                +                      D                          B              ,              33                                      4            .      
Next, a process of interpolating an R or B color value in a pixel having only a G color value. For example, in order to interpolate the B color value (B23) of a pixel (2,3) having only a G color value (G23), the mean of the difference image channel values (DB,13, DB,33) of pixels (1,3) and (3,3) having B color values and adjacent to the pixel (2,3) is subtracted from the G color value (G23) of the pixel (2,3).
That is, the difference image channel values (DB,13, DB,33) of pixels (1,3) and (3,3) are DB,13=G13−B13, DB,33=G33−B33, respectively, and the interpolated B color value (B23) of the pixel (2,3) is
      B    23    ′    =            G      23        -                                        D                          B              ,              13                                +                      D                          B              ,              33                                      2            .      
Thus, according to the smooth hue transition interpolation, the mean of difference channel values at pixel positions having information on a color channel that is desired to be interpolated is obtained and by adding the mean to or subtracting the mean from the color value of the pixel to be currently interpolated, color interpolation is performed. However, the conventional color interpolation methods do not consider edge information of an image effectively and the correlations among colors well. Accordingly, when color interpolation is performed, a color totally different from the original color is interpolated on an edge, such as the contour or boundary of an object, and there occurs a problem of a false color error that is a phenomenon in which some pixels are standing out unseemly with neighboring pixels, or a moiré effect in which colorful color distortion like a rainbow occurs in a cheque pattern image.